from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import UserViewSet, BankCardViewSet, TransactionViewSet
from django.urls import path
from .views import login, admin_dashboard, client_dashboard, register

urlpatterns = [
    path('login/', login, name='login'),
    path('admin-dashboard/', admin_dashboard, name='admin_dashboard'),
    path('client-dashboard/', client_dashboard, name='client_dashboard'),
    path('register/', register, name='register'),  # 添加注册路由
]
# 自动生成路由
router = DefaultRouter()
router.register(r'users', UserViewSet, basename='user')
router.register(r'cards', BankCardViewSet, basename='card')
router.register(r'transactions', TransactionViewSet, basename='transaction')

#urlpatterns = [
#    path("", include(router.urls)),
#]